package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.GainmedalMapper;
import com.jsb.model.Gainmedal;
import com.jsb.model.GainmedalExample;

@Service
public class GainmedalService{
	
	@Resource
	private GainmedalMapper gainmedalMapper;
	
	public void addGainmedal(Gainmedal gainmedal) {
		gainmedalMapper.insertSelective(gainmedal);
	}
	
	public void delGainmedalByPhone(String phone) {
		gainmedalMapper.deleteByPrimaryKey(phone);
	}
	
	public void updateGainmedal(Gainmedal gainmedal) {
		gainmedalMapper.updateByPrimaryKeySelective(gainmedal);
	}
	
	public void updateGainmedalByExample(Gainmedal gainmedal,GainmedalExample gainmedalExample){
	    gainmedalMapper.updateByExampleSelective(gainmedal,gainmedalExample);
	}
	
	public Gainmedal getGainmedalByPhone(String phone) {
		return gainmedalMapper.selectByPrimaryKey(phone);
	}
	
	public List<Gainmedal> getPageGainmedal(GainmedalExample gainmedalExample) {
		return gainmedalMapper.selectPage(gainmedalExample);
	}
	
	public int countGainmedal(GainmedalExample gainmedalExample) {
		return gainmedalMapper.countByExample(gainmedalExample);
	}
	
	public List<Gainmedal> selectByExample(GainmedalExample example){
	    return gainmedalMapper.selectByExample(example);
	}
}
